﻿CREATE PROCEDURE [dbo].[sp_Update_AgentRatio]
	@ID int,
	@ActiveContacts float,
	@ActiveAppointMade float,
	@ActiveAppointKept float,
	@ActivePresentation float,
	@ActiveAppointSale float,
	@LapsedContacts float,
	@LapsedAppointMade float,
	@LapsedAppointKept float,
	@LapsedPresentation float,
	@LapsedAppointSale float,
	@NeighborContacts float,
	@NeighborAppointMade float,
	@NeighborAppointKept float,
	@NeighborPresentation float,
	@NeighborAppointSale float,
	@BusinessContacts float,
	@BusinessAppointMade float,
	@BusinessAppointKept float,
	@BusinessPresentation float,
	@BusinessAppointSale float,
	@RefContacts float,
	@RefAppointMade float,
	@RefAppointKept float,
	@RefPresentation float,
	@RefAppointSale float,
	@TSystemContacts float,
	@TSystemAppointMade float,
	@TSystemAppointKept float,
	@TSystemPresentation float,
	@TSystemAppointSale float,
	@TargetMarketContacts float,
	@TargetMarketAppointMade float,
	@TargetMarketAppointKept float,
	@TargetMarketPresentation float,
	@TargetMarketAppointSale float,
	@FieldContacts float,
	@FieldAppointMade float,
	@FieldAppointKept float,
	@FieldPresentation float,
	@FieldAppointSale float,
	@AvgAPVperApp float
AS
	UPDATE [dbo].[Agents]
   SET [ActiveContacts] = @ActiveContacts
      ,[ActiveAppointMade] = @ActiveAppointMade
      ,[ActiveAppointKept] = @ActiveAppointKept
      ,[ActivePresentation] = @ActivePresentation
      ,[ActiveAppointSale] = @ActiveAppointSale
      ,[LapsedContacts] = @LapsedContacts
      ,[LapsedAppointMade] = @LapsedAppointMade
      ,[LapsedAppointKept] = @LapsedAppointKept
      ,[LapsedPresentation] = @LapsedPresentation
      ,[LapsedAppointSale] = @LapsedAppointSale
      ,[NeighborContacts] = @NeighborContacts
      ,[NeighborAppointMade] = @NeighborAppointMade
      ,[NeighborAppointKept] = @NeighborAppointKept
      ,[NeighborPresentation] = @NeighborPresentation
      ,[NeighborAppointSale] = @NeighborAppointSale
      ,[BusinessContacts] = @BusinessContacts
      ,[BusinessAppointMade] = @BusinessAppointMade
      ,[BusinessAppointKept] = @BusinessAppointKept
      ,[BusinessPresentation] = @BusinessPresentation
      ,[BusinessAppointSale] = @BusinessAppointSale
      ,[RefContacts] = @RefContacts
      ,[RefAppointMade] = @RefAppointMade
      ,[RefAppointKept] = @RefAppointKept
      ,[RefPresentation] = @RefPresentation
      ,[RefAppointSale] = @RefAppointSale
      ,[TSystemContacts] = @TSystemContacts
      ,[TSystemAppointMade] = @TSystemAppointMade
      ,[TSystemAppointKept] = @TSystemAppointKept
      ,[TSystemPresentation] = @TSystemPresentation
      ,[TSystemAppointSale] = @TSystemAppointSale
      ,[TargetMarketContacts] = @TargetMarketContacts
      ,[TargetMarketAppointMade] = @TargetMarketAppointMade
      ,[TargetMarketAppointKept] = @TargetMarketAppointKept
      ,[TargetMarketPresentation] = @TargetMarketPresentation
      ,[TargetMarketAppointSale] = @TargetMarketAppointSale
      ,[FieldContacts] = @FieldContacts
      ,[FieldAppointMade] = @FieldAppointMade
      ,[FieldAppointKept] = @FieldAppointKept
      ,[FieldPresentation] = @FieldPresentation
      ,[FieldAppointSale] = @FieldAppointSale
      ,[AvgAPVperApp] = @AvgAPVperApp
		WHERE ID = @ID